/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package chameleon.view.command;

import chameleon.model.NuGatManager.NuGatManager;
import chameleon.view.input.Input;

/**
 * This command is only for NuGat manager.
 *
 * @author simon
 */
class WriteFlatModelCommand extends Command {

    public WriteFlatModelCommand(Input input, boolean help) {
        super(input,false,help);
    }

    @Override
    public Input execute() {
        if (!help_){
            InternalCheckCommand check = new InternalCheckCommand(input_, 2);
            if (check.isOk()){
                NuGatManager manager = (NuGatManager) input_.getManager();
                if(manager == null)
                    outputManager_.displayString("Please use build_model before!\n");
                else
                    manager.writeFlatModel();
                outputManager_.displayString("\n");
            }
        }
        else{
            outputManager_.displayString("Write the flat model");
        }
        return input_;
    }



}
